import io.netty.channel.{ChannelHandlerContext, ChannelInboundHandlerAdapter}

/**
  * Created by Administrator on 2017/9/16.
  */
class TestClientHandler extends ChannelInboundHandlerAdapter{
    override def channelActive(ctx: ChannelHandlerContext): Unit = {
        println("client channel active")
    }

    override def channelRead(ctx: ChannelHandlerContext, msg: scala.Any): Unit = {
        println("client channel read message ", msg.toString)
    }

    override def exceptionCaught(ctx: ChannelHandlerContext, cause: Throwable): Unit = {
        cause.printStackTrace
        ctx.close
    }
}
